#include "diceroller.h"

DiceRoller::DiceRoller (QWidget *parent)
        :QGroupBox(parent)
{
    nDice=new LabeledSlider;
    nDice->slider->setRange(1,10);
    QStringList dices;
    dices<<"1"<<"2"<<"3"<<"4"<<"5"<<"6"<<"7"<<"8"<<"9"<<"10";
    nDice->setLabels(dices);

    nSide=new LabeledSlider;
    nSide->slider->setRange(1,8);
    //WORK HERE. THE SIZES ARE LINEAR
    QStringList sides;
    sides<<"4"<<"6"<<"8"<<"10"<<"12"<<"20"<<"50"<<"100";
    nSide->setLabels(sides);

    nDifD=new LabeledSlider;
    nDifD->slider->setRange(0,9);
    QStringList dif;
    dif<<"0"<<"1"<<"2"<<"3"<<"4"<<"5"<<"6"<<"7"<<"8"<<"9";
    nDifD->setLabels(dif);

    nDifU=new LabeledSlider;
    nDifU->slider->setRange(0,9);
    nDifU->setLabels(dif);
    //LAYOUT
    rolers=new QHBoxLayout;
    rolers->addWidget(nDice);
    rolers->addWidget(nSide);
    rolers->addWidget(nDifD);
    rolers->addWidget(nDifU);
    setLayout(rolers);
}
/*
int DiceRoller::roll(int low, int high)
{
    return qrand() % ((high + 1) - low) + low;
}
//int randomValue = roll(0,100);
*/
